<!doctype html>
<html lang="${lang}">
    <head>
        <meta charset="UTF-8">
        <link rel="stylesheet" type="text/css" href="@{'/public/stylesheets/admin.css'}" media="all" />
        <script src="@{'/public/javascripts/jquery-1.5.2.min.js'}"></script>
        <script src="@{'/public/javascripts/admin/hideshow.js'}"></script>
        <script src="@{'/public/javascripts/admin/jquery.tablesorter.min.js'}"></script>
        <script src="@{'/public/javascripts/admin/jquery.equalHeight.js'}"></script>
        <script type="text/javascript">
            $(document).ready(function() 
            { 
                $(".tablesorter").tablesorter(); 
            } 
        );
            $(document).ready(function() {

                //When page loads...
                $(".tab_content").hide(); //Hide all content
                $("ul.tabs li:first").addClass("active").show(); //Activate first tab
                $(".tab_content:first").show(); //Show first tab content

                //On Click Event
                $("ul.tabs li").click(function() {

                    $("ul.tabs li").removeClass("active"); //Remove any "active" class
                    $(this).addClass("active"); //Add "active" class to selected tab
                    $(".tab_content").hide(); //Hide all tab content

                    var activeTab = $(this).find("a").attr("href"); //Find the href attribute value to identify the active tab + content
                    $(activeTab).fadeIn(); //Fade in the active ID content
                    return false;
                });

            });
        </script>
        <script type="text/javascript">
            $(function(){
                $('.column').equalHeight();
            });
        </script>


        <title>#{get 'title' /}</title>
    </head>
    <body>
        <header id="header">
            <hgroup>
                <h1 class="site_title"><a href="@{Admin.index}">Administration</a></h1>
                <h2 class="section_title">Dashboard</h2><div class="btn_view_site"><a href="@{Application.index}">Site</a></div><div class="btn_view_site"><a href="@{Forum.index}">Forum</a></div>
            </hgroup>
        </header> <!-- end of header bar -->

        <section id="secondary_bar">
            <div class="user">
                <a href="@{Users.profil(user.id)}"><p>${user.firstname} ${user.lastname}</p></a>
                <a class="logout_user" href="@{secure.logout}" title="Logout">Logout</a>
            </div>
            <div class="breadcrumbs_container">
                <article class="breadcrumbs"><a href="@{Admin.index}">Console D'administration</a> <div class="breadcrumb_divider"></div> <a class="current">Dashboard</a></article>
            </div>
        </section><!-- end of secondary bar -->
        <aside id="sidebar" class="column">
            <form class="quick_search">
                <input type="text" value="Quick Search" onfocus="if(!this._haschanged){this.value=''};this._haschanged=true;">
            </form>
            <hr/>


            #{if user.groups.id == 1}
            <h3>Articles</h3>
            <ul class="toggle">
                <li class="icn_edit_article"><a href="@{Articles.list}">Gestion des articles</a></li>
                <li class="icn_new_article"><a href="@{Articles.create}">Ajouter un article</a></li>
                <li class="icn_categories"><a href="@{Categories.list}">Catégories</a></li>
            </ul>
            <h3>Utilisateurs et Groupes</h3>
            <ul class="toggle">
                <li class="icn_profile"><a href="@{Users.profil(user.id)}">Votre Profile</a></li>
                <li class="icn_view_users"><a href="@{Users.list}">Gestion des Utilisateurs</a></li>
                <li class="icn_add_user"><a href="@{Users.create}">Ajouter un Utilisateur</a></li>

                <hr />
                <li class="icn_view_users"><a href="@{Groups.list}">Liste des Groupes</a></li>


            </ul>
            <h3>Clients</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Customers.list}">Gestion des Clients</a></li>
            </ul>
            <h3>Employés</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Employees.list}">Gestion des Employés</a></li>
            </ul>
            <h3>Formations</h3>
            <ul class="toggle">
                <li class="icn_settings"><a href="@{Formations.list}">Gestion des formations</a></li>
                <li class="icn_new_article"><a href="@{Formations.create}">Ajout d'une formations</a></li>
                <hr />
                <li class="icn_settings"><a href="@{FormationTypes.list}">Gestion des Type de Formation</a></li>
            </ul>
            <h3>Disponibilité</h3>
            <ul class="toggle">
                <li class="icn_settings"><a href="@{Availabilities.list}">Gestion des Disponibilités</a></li>
                <li class="icn_new_article"><a href="@{Availabilities.create}">Ajout d'une Disponibilité</a></li>
            </ul>

            <h3>Vehicule</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Vehicules.list}">Gestion des Vehicules</a></li>
                <li class="icn_new_article"><a href="@{Vehicules.create}">Ajouter un Vehicules</a></li>
            </ul>
            <h3>Circuit</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Circuits.list}">Gestion des Circuits</a></li>
                <li class="icn_new_article"><a href="@{Circuits.create}">Ajouter un Circuit</a></li>

            </ul>
		#{/if}


            #{if user.groups.id == 2}

            <h3>Utilisateurs et Groupes</h3>
            <ul class="toggle">
                <li class="icn_profile"><a href="@{Users.profil(user.id)}">Votre Profile</a></li>
                <li class="icn_view_users"><a href="@{Users.list}">Gestion des Utilisateurs</a></li>
                <li class="icn_add_user"><a href="@{Users.create}">Ajouter un Utilisateur</a></li>

                <hr />
                <li class="icn_view_users"><a href="@{Groups.list}">Liste des Groupes</a></li>


            </ul>
            <h3>Clients</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Customers.list}">Gestion des Clients</a></li>
            </ul>

            <h3>Formations</h3>
            <ul class="toggle">
                <li class="icn_settings"><a href="@{Formations.list}">Gestion des formations</a></li>
                <li class="icn_new_article"><a href="@{Formations.create}">Ajout d'une formations</a></li>
                <hr />
                <li class="icn_settings"><a href="@{FormationTypes.list}">Gestion des Type de Formation</a></li>
            </ul>
            <h3>Disponibilité</h3>
            <ul class="toggle">
                <li class="icn_settings"><a href="@{Availabilities.list}">Gestion des Disponibilités</a></li>
                <li class="icn_new_article"><a href="@{Availabilities.create}">Ajout d'une Disponibilité</a></li>
            </ul>

            <h3>Vehicule</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Vehicules.list}">Gestion des Vehicules</a></li>
                <li class="icn_new_article"><a href="@{Vehicules.create}">Ajouter un Vehicules</a></li>
            </ul>
            <h3>Circuit</h3>
            <ul class="toggle">
                <li class="icn_folder"><a href="@{Circuits.list}">Gestion des Circuits</a></li>
                <li class="icn_new_article"><a href="@{Circuits.create}">Ajouter un Circuit</a></li>

            </ul>
		#{/if}

            #{if user.groups.id == 3}

            <h3>Mon profil Client</h3>
            <ul class="toggle">
                <li class="icn_profile"><a href="@{Users.profil(user.id)}">Mes Informations</a></li><hr />
                <li class="icn_view_users"><a href="@{Formations.maFormation}">Ma Formation</a></li><hr />
            </ul>

            <h3>Faire une demande</h3>
            <ul class="toggle">
                <li class="icn_view_users"><a href="@{Formations.demande}">Formation</a></li><hr />
                <li class="icn_profile"><a href="@{Formations.examen}">Passage à un examen</a></li><hr />
            </ul>
		#{/if}

            <footer>
            </footer>
        </aside><!-- end of sidebar -->
        <section id="main" class="column">
	#{doLayout /}
        </section>

    </body>
</html>